package com.jsbj.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jsbj.user.entities.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 系统登录用户表 Mapper 接口
 * </p>
 *
 * @author jsbj
 * @since 2022-02-21
 */
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {

    List<Map<String, Object>> getUsersByTenantCode(String tenantCode);

    List<Map<String, Object>> getAllUserByTenantCode(@Param("tenantCode") String tenantCode);

    List<String> queryDistinctField(Map<String, Object> params);

    List<String> queryIsStatus(Map<String, Object> params);

    List<String> selectRoleList(Map<String, Object> params);

    List<Map<String, Object>> getUser(@Param("tenantCode")String tenantCode);

    List<String> selectRoleList1(@Param("params") Map<String, Object> params);

    List<SysUser> queryUsersByGroupIds(List<String> groupIdList);

    List<SysUser> queryUsersByTenantCode(String tenantCode);

    IPage<Map<String, Object>> getUserListPage(Page<Map<String, Object>> page, Map<String, Object> params);

    List<Map<String, Object>> getUsersByTenantCodeAndOrgCode(@Param("tenantCode")String tenantCode, @Param("orgCode")String orgCode);

    List<Map<String, Object>> getUserListByTenantCodeAndOrgCode(Map<String, Object> params);

    List<Map<String, Object>> getUserListByTenantCodeAndOrgCodeSuper(Map<String, Object> params);

    List<SysUser> getByRoleCode(String roleCode);

    String getUserOrgInfoByUserId(@Param("userId") String userId, @Param("tenantCode") String tenantCode);
}
